/*
 * @Author: chentao 
 * @Date: 2022-05-07 14:14:08 
 * @Last Modified by: chentao
 * @Last Modified time: 2022-05-13 13:48:06
 */
var result = Object.create(null) //支持参数为object或者null
console.log("result",result);

const point1:{} ={
    x:1,
    y:2,
    z:3
}
console.log("point1",point1)
const point2:Object ={
    x:1,
    y:2,
}
let point3:{x:number,y:string,z?:string};
point3={
    x:2,
    y:"鳄鱼",
    z:"w技能削弱"
}
console.log(point3);
//只读属性 readonly
let point4:{ readonly x:number, y:string,z?:string};
point4={
    x:3,
    y:"onlyString",
    z:'string'
}
console.log(point4)
//point4.x =6; //可读属性不可修改
point4.z="吹牛逼"; //可以修改
console.log(point4) //{ x: 3, y: 'onlyString', z: '吹牛逼' }

//5.11.3.5空对象类型字面量
const point5:{} = {
     x:3,
     y:3
}
console.log(point5)
const point6:Object ={
    x:3,
    y:6
}
console.log(point6)
//ts类型系统的弱类型
let config:{
     url?:string;
     async?:boolean;
     timeout?:number;
}
//多余属性
let point7:{x:number,y:number} ={x:3,y:4}; //比如这个对象么有多余的属性
//修改代码如下
//let point8:{x:number,y:number} ={x:5,y:7,z:9}; //通常情况下多余属性编译器直接就会检查出来 一写就直接报错
//能够忽略多余属性检查的方法  使用断言 可以忽略检查多余属性
let point8:{x:number;y:number} = {x:3,y:4,z:7} as {x:number;y:number} ; //这样的话就忽略了编译器报错
// 启用“--suppressExcessPropertyErrors”编译选项。